function y=SS_eq_noCBDC_fast(func_var,pi_m,x0,opt)
%====================================================
% A faster code to compute equilibrium than SS_eq_noCBDC 
% when alphas change. But it is normally not as robust.
% COPY RIGHT: Yu Zhu
%==================================================
options=optimset('tolX',1e-10,'tolFun',1e-10);
p_bar=func_var.p_bar;
rho_bar= func_var.rho_bar;
Nb = func_var.Nb;
rho_low = 1/(1+pi_m)-1;
xlow=[0,0,rho_low];
xhigh = [p_bar,p_bar,rho_bar];
xlow1=[0,0];
xhigh1 = [p_bar,p_bar];
if opt==1
    
    [x01,fval] = fmincon(@(x)1,x0(1:2),[],[],[],[],xlow1,xhigh1,@(x)eq_func_con([x,rho_low],Nb,pi_m,func_var,0),options);
    eq_cond=eq_func([x01,rho_low],pi_m,func_var,1);
    if eq_cond(3)<0
        y = [x01,rho_low];
    else
        [y,fval] = fmincon(@(x)1,[x01,rho_low],[],[],[],[],xlow,xhigh,@(x)eq_func_con(x,Nb,pi_m,func_var,1),options);
    end
else
    [y,fval] = fmincon(@(x)1,x0,[],[],[],[],xlow,xhigh,@(x)eq_func_con(x,pi_m,func_var,1),options);
    
end
y=fsolve(@(x)eq_func(x,pi_m,func_var,1),y);
eq_func(y,pi_m,func_var,1)